#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
/*
 * Zenlayer.com Inc.
 * Copyright (c) 2014-2020 All Rights Reserved.
 */
package ${package}.${artifactId}.data.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @author yangshen
 * @date 2019-10-19 17:08:31
 * @version ${symbol_dollar} Id: AggregationMapper.java, v 0.1  yangshen Exp ${symbol_dollar}
 */
@tk.mybatis.mapper.annotation.RegisterMapper
public interface AggregationBaseMapper<T> {
    /**
     * 根据example和aggregateCondition进行聚合查询
     * 分组不支持having条件过滤， 如需要建议使用xml文件
     *
     * @param example
     * @param aggregateCondition 可以设置聚合查询的属性和分组属性
     * @return 返回聚合查询属性和分组属性的值
     */
    @SelectProvider(type = AggregationProviderPlus.class, method = "dynamicSQL")
    @Results({@Result(column = "create_time", property = "createTime")})
    List<T> selectAggregationByExample(@Param("example") Object example,
                                       @Param("aggregateCondition") AggregateCondition aggregateCondition);

}
